using System;
using System.Windows;

namespace FluentSilverlight.Expressions
{
    public class VerticalAlignmentExpression<TParentPart>
    {
        private readonly TParentPart parentPart;
        private readonly Action<VerticalAlignment> setValue;

        public VerticalAlignmentExpression(TParentPart parentPart, Action<VerticalAlignment> setValue)
        {
            this.parentPart = parentPart;
            this.setValue = setValue;
        }

        public TParentPart Center()
        {
            setValue(VerticalAlignment.Center);
            return parentPart;
        }

        public TParentPart Bottom()
        {
            setValue(VerticalAlignment.Bottom);
            return parentPart;
        }

        public TParentPart Top()
        {
            setValue(VerticalAlignment.Top);
            return parentPart;
        }

        public TParentPart Stretch()
        {
            setValue(VerticalAlignment.Stretch);
            return parentPart;
        }
    }
}